<?php

class Admin_Cms_DealStatisticsController extends My_Controller_Action
{
	public function init()
	{
		parent::init();
		
		$auth = Zend_Auth::getInstance();
        
        if(!$auth->hasIdentity())
        { 
            $this->_redirect("user/account/login");
        }
        
        if ($this->isAccess($auth->getIdentity()->group_id, 9))
        {
			//to do
		} else {
            die("Access denied");
        }
	}
	
	public function indexAction()
	{
		$this->view->rightAdminModules('right');
		
		$this->view->by = $this->_request->getParam("by", "b.deadline");
        $this->view->order = $this->_request->getParam("order", "desc");
        $this->view->filter = $this->_request->getParam("filter", "");
		
		Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
    	$model = $this->loadModel('admin_cms', 'Deal');
		$this->view->paginator = $model->getDeals($this->_getParam('page', 1), $this->view->by.' '.$this->view->order, $this->view->filter);
	}
}